module.exports = (app) => {
  const mongoose = app.mongoose;
  mongoose.pluralize(null);
  const Schema = mongoose.Schema;
  const UserSchema = new Schema(
    {
      avatar: {
        type: String,
        default:
          "https://bucket-chabaidao-1308160773.cos.ap-guangzhou.myqcloud.com/img/1713410939060vatar.webp",
      },
      nickname: {
        type: String,
        default: "默认昵称6个字",
      },
      phone: {
        type: String,
        default: "",
      },
      gender: {
        type: Number,
        default: 2,
      },
      birthday: {
        type: String,
        default: "1900-01-01",
      },
      openid: {
        type: String,
        required: true,
      },
    },
    { versionKey: false }
  );

  return mongoose.model("Userinfo", UserSchema);
};
